package com.baidu.location;

import android.content.Context;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.Message;
import android.os.Messenger;
import java.util.ArrayList;
import java.util.Iterator;

public final class e
{
  private ServiceConnection A = new g(this);
  private String a = "3.3";
  private long b = 0L;
  private long c = 0L;
  private String d = null;
  private k e = new k();
  private boolean f = false;
  private Context g = null;
  private Messenger h = null;
  private h i = new h(this, 0);
  private final Messenger j = new Messenger(this.i);
  private ArrayList k = null;
  private a l = null;
  private boolean m = false;
  private boolean n = false;
  private boolean o = false;
  private j p = null;
  private boolean q = false;
  private boolean r = false;
  private final Object s = new Object();
  private i t = null;
  private boolean u = false;
  private c v = null;
  private String w = null;
  private String x = "http://loc.map.baidu.com/sdk.php";
  private Boolean y = Boolean.valueOf(false);
  private Boolean z = Boolean.valueOf(false);

  public e(Context paramContext)
  {
    this.g = paramContext;
    this.e = new k();
    this.t = new i(this.g, this);
  }

  private void a(int paramInt)
  {
    Iterator localIterator;
    if ((paramInt == 26) && (this.n == true))
    {
      localIterator = this.k.iterator();
      while (localIterator.hasNext())
        ((c)localIterator.next()).b(this.l);
      this.n = false;
    }
    if (((this.m != true) && (((this.e.h != true) || (this.l.f() != 61))) && (this.l.f() != 66) && (this.l.f() != 67)) || ((this.e != null) && (this.e.e()) && (this.l.f() == 65)));
    do
    {
      return;
      localIterator = this.k.iterator();
      while (localIterator.hasNext())
        ((c)localIterator.next()).a(this.l);
    }
    while ((this.l.f() == 66) || (this.l.f() == 67));
    this.m = false;
  }

  private Bundle e()
  {
    if (this.e == null)
      return null;
    Bundle localBundle = new Bundle();
    localBundle.putString("packName", this.d);
    localBundle.putString("prodName", this.e.f);
    localBundle.putString("coorType", this.e.a);
    localBundle.putString("addrType", this.e.b);
    localBundle.putString("Url", this.x);
    localBundle.putBoolean("openGPS", this.e.c);
    localBundle.putBoolean("location_change_notify", this.e.h);
    localBundle.putInt("scanSpan", this.e.d);
    localBundle.putInt("timeOut", this.e.e);
    localBundle.putInt("priority", this.e.g);
    localBundle.putBoolean("map", this.y.booleanValue());
    localBundle.putBoolean("import", this.z.booleanValue());
    return localBundle;
  }

  public final void a()
  {
    this.i.obtainMessage(11).sendToTarget();
  }

  public final void a(c paramc)
  {
    Message localMessage = this.i.obtainMessage(8);
    localMessage.obj = paramc;
    localMessage.sendToTarget();
  }

  public final void a(k paramk)
  {
    Message localMessage = this.i.obtainMessage(3);
    localMessage.obj = paramk;
    localMessage.sendToTarget();
  }

  public final int b()
  {
    if ((this.h == null) || (this.j == null))
      return 1;
    if ((this.k == null) || (this.k.size() <= 0))
      return 2;
    if (System.currentTimeMillis() - this.b < 1000L)
      return 6;
    ak.e();
    this.i.obtainMessage(4).sendToTarget();
    return 0;
  }

  public final void b(c paramc)
  {
    Message localMessage = this.i.obtainMessage(5);
    localMessage.obj = paramc;
    localMessage.sendToTarget();
  }

  public final void c()
  {
    this.i.obtainMessage(1).sendToTarget();
  }

  public final void d()
  {
    this.i.obtainMessage(2).sendToTarget();
  }
}